package HttpBean.Request.RequestImpl;

import HttpBean.Request.Request;
import HttpBean.Request.RequestHeader;
import HttpBean.Request.RequestLine;

import java.io.IOException;

public class RequestGetStringImpl extends Request {
    private RequestLine requestLine;
    private RequestHeader requestHeader;

    public RequestGetStringImpl(String[] strs, RequestLine requestLine) throws IOException {
        this.requestLine = requestLine;
        this.requestHeader = new RequestHeader();
        for(int i=0;i<strs.length;i++){
            if(strs[i] != null) {
                requestHeader.insert(strs[i]);
            }
        }

    }

    public RequestHeader getRequestHead() {
        return requestHeader;
    }

    public RequestLine getRequestLine() {
        return requestLine;
    }

    @Override
    public String toString() {
        return "RequestGetImpl{" +
                "requestHead=" + requestLine.toString() +
                ", requestLine=" + requestHeader.toString() +
                '}';
    }
}
